<!doctype html>


<html>
<head>
  <link rel="shortcut icon" href="static/images/favicon.ico" type="image/x-icon">
  <title>structs (Closure Library API Documentation - JavaScript)</title>
  <link rel="stylesheet" href="static/css/base.css">
  <link rel="stylesheet" href="static/css/doc.css">
  <link rel="stylesheet" href="static/css/sidetree.css">
  <link rel="stylesheet" href="static/css/prettify.css">

  <script>
     var _staticFilePath = "static/";
     var _typeTreeName = "goog";
     var _fileTreeName = "Source";
  </script>

  <script src="static/js/doc.js">
  </script>


  <meta charset="utf8">
</head>

<body onload="grokdoc.onLoad();">

<div id="header">
  <div class="g-section g-tpl-50-50 g-split">
    <div class="g-unit g-first">
      <a id="logo" href="index.html">Closure Library API Documentation</a>
    </div>

    <div class="g-unit">
      <div class="g-c">
        <strong>Go to class or file:</strong>
        <input type="text" id="ac">
      </div>
    </div>
  </div>
</div>





<div class="colmask rightmenu">
<div class="colleft">
    <div class="col1">
      <!-- Column 1 start -->

<div id="title">
       <span class="fn">structs</span>
</div>

<hr/>


  <h2>Classes</h2>
 <div class="fn-constructor">
        <a href="class_goog_structs_AvlTree.html">
          goog.structs.AvlTree</a><br/>
        <div class="class-details">Constructs an AVL-Tree, which uses the specified comparator to order its
values. The values can be accessed efficiently in their sorted order since
the tree enforces a O(logn) maximum height.

</div>
 </div>
 <div class="fn-constructor">
        <a href="class_goog_structs_CircularBuffer.html">
          goog.structs.CircularBuffer</a><br/>
        <div class="class-details">Class for CircularBuffer.
</div>
 </div>
 <div class="fn-constructor">
        <a href="interface_goog_structs_Collection.html">
          goog.structs.Collection</a><br/>
        <div class="class-details">An interface for a collection of values.
</div>
 </div>
 <div class="fn-constructor">
        <a href="class_goog_structs_Heap.html">
          goog.structs.Heap</a><br/>
        <div class="class-details">Class for a Heap datastructure.

</div>
 </div>
 <div class="fn-constructor">
        <a href="class_goog_structs_InversionMap.html">
          goog.structs.InversionMap</a><br/>
        <div class="class-details">Maps ranges to values.
</div>
 </div>
 <div class="fn-constructor">
        <a href="class_goog_structs_LinkedMap.html">
          goog.structs.LinkedMap</a><br/>
        <div class="class-details">Class for a LinkedMap datastructure, which combines O(1) map access for
key/value pairs with a linked list for a consistent iteration order. Sample
usage:

<pre class="lang-js prettyprint">
var m = new LinkedMap();
m.set('param1', 'A');
m.set('param2', 'B');
m.set('param3', 'C');
alert(m.getKeys()); // param1, param2, param3

var c = new LinkedMap(5, true);
for (var i = 0; i &lt; 10; i++) {
  c.set('entry' + i, false);
}
alert(c.getKeys()); // entry9, entry8, entry7, entry6, entry5

c.set('entry5', true);
c.set('entry1', false);
alert(c.getKeys()); // entry1, entry5, entry9, entry8, entry7
</pre></div>
 </div>
 <div class="fn-constructor">
        <a href="class_goog_structs_Map.html">
          goog.structs.Map</a><br/>
        <div class="class-details">Class for Hash Map datastructure.
</div>
 </div>
 <div class="fn-constructor">
        <a href="class_goog_structs_Node.html">
          goog.structs.Node</a><br/>
        <div class="class-details">A generic immutable node. This can be used in various collections that
require a node object for its item (such as a heap).
</div>
 </div>
 <div class="fn-constructor">
        <a href="class_goog_structs_Pool.html">
          goog.structs.Pool</a><br/>
        <div class="class-details">A generic pool class. If min is greater than max, an error is thrown.
</div>
 </div>
 <div class="fn-constructor">
        <a href="class_goog_structs_PriorityPool.html">
          goog.structs.PriorityPool</a><br/>
        <div class="class-details">A generic pool class. If max is greater than min, an error is thrown.
</div>
 </div>
 <div class="fn-constructor">
        <a href="class_goog_structs_PriorityQueue.html">
          goog.structs.PriorityQueue</a><br/>
        <div class="class-details">Class for Priority Queue datastructure.

</div>
 </div>
 <div class="fn-constructor">
        <a href="class_goog_structs_QuadTree.html">
          goog.structs.QuadTree</a><br/>
        <div class="class-details">Constructs a new quad tree.
</div>
 </div>
 <div class="fn-constructor">
        <a href="class_goog_structs_Queue.html">
          goog.structs.Queue</a><br/>
        <div class="class-details">Class for FIFO Queue data structure.

</div>
 </div>
 <div class="fn-constructor">
        <a href="class_goog_structs_Set.html">
          goog.structs.Set</a><br/>
        <div class="class-details">A set that can contain both primitives and objects.  Adding and removing
elements is O(1).  Primitives are treated as identical if they have the same
type and convert to the same string.  Objects are treated as identical only
if they are references to the same object.  WARNING: A goog.structs.Set can
contain both 1 and (new Number(1)), because they are not the same.  WARNING:
Adding (new Number(1)) twice will yield two distinct elements, because they
are two different objects.  WARNING: Any object that is added to a
goog.structs.Set will be modified!  Because goog.getUid() is used to
identify objects, every object in the set will be mutated.
</div>
 </div>
 <div class="fn-constructor">
        <a href="class_goog_structs_SimplePool.html">
          goog.structs.SimplePool</a><br/>
        <div class="class-details">A generic pool class. Simpler and more efficient than goog.structs.Pool
because it doesn't maintain a list of objects that are in use. This class
has constant overhead and doesn't create any additional objects as part of
the pool management after construction time.

IMPORTANT: If the objects being pooled are arrays or maps that can have
unlimited number of properties, they need to be cleaned before being
returned to the pool.

Also note that  actually allocates an array to clean
the object passed to it, so simply using this function would defy the
purpose of using the pool.

</div>
 </div>
 <div class="fn-constructor">
        <a href="class_goog_structs_StringSet.html">
          goog.structs.StringSet</a><br/>
        <div class="class-details">Creates a set of strings.
</div>
 </div>
 <div class="fn-constructor">
        <a href="class_goog_structs_TreeNode.html">
          goog.structs.TreeNode</a><br/>
        <div class="class-details">Generic tree node data structure with arbitrary number of child nodes.
It is possible to create a dynamic tree structure by overriding
<code> #getParent</code> and <code> #getChildren</code> in a subclass. All other getters
will automatically work.

</div>
 </div>
 <div class="fn-constructor">
        <a href="class_goog_structs_Trie.html">
          goog.structs.Trie</a><br/>
        <div class="class-details">Class for a Trie datastructure.  Trie data structures are made out of trees
of Trie classes.

</div>
 </div>
   
<br/>

  <div class="legend">
        <span class="key publickey"></span><span>Public</span>
        <span class="key protectedkey"></span><span>Protected</span>
        <span class="key privatekey"></span><span>Private</span>
  </div>









<div class="section">
  <table class="horiz-rule">


  </table>
</div>




  <h2>Global Functions</h2>





<div class="section">
  <table class="horiz-rule">


     <tr class="even entry public">
       <td class="access"></td>






  <td>
    <a name="goog.structs.clear"></a>


     <div class="arg">
       <img align="left" src="static/images/blank.gif">

        <span class="entryNamespace">goog.structs.</span><span class="entryName">clear<span class="args">(<span class="arg">col</span>)</span>
        </span>
      </div>


     <div class="entryOverview">
       Removes all the elements from the collection.

     </div>


    <! -- Method details -->
    <div class="entryDetails">

      <div class="detailsSection">
        <b>Arguments: </b>






<table class="horiz-rule">
     
   <tr class="even">
     <td>
        <span class="entryName">col</span>
        : <span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Object">Object</a></span>
        <div class="entryOverview">The collection-like object.</div>
     </td>
   </tr>
  </table>
      </div>
   
  
    </div>
   
  </td>


  <td class="view-code">
     <a href="local_closure_goog_structs_structs.js.source.html#line148">code &raquo;</a>
  </td>
     </tr>


     <tr class="odd entry public">
       <td class="access"></td>






  <td>
    <a name="goog.structs.contains"></a>


     <div class="arg">
       <img align="left" src="static/images/blank.gif">

        <span class="entryNamespace">goog.structs.</span><span class="entryName">contains<span class="args">(<span class="arg">col</span>,&nbsp;<span class="arg">val</span>)</span>
        </span>
        &#8658; <span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Boolean">boolean</a></span>
      </div>


     <div class="entryOverview">
       Whether the collection contains the given value. This is O(n) and uses
equals (==) to test the existence.

     </div>


    <! -- Method details -->
    <div class="entryDetails">

      <div class="detailsSection">
        <b>Arguments: </b>






<table class="horiz-rule">
     
   <tr class="even">
     <td>
        <span class="entryName">col</span>
        : <span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Object">Object</a></span>
        <div class="entryOverview">The collection-like object.</div>
     </td>
   </tr>
     
   <tr class="odd">
     <td>
        <span class="entryName">val</span>
        : <span class="type">*</span>
        <div class="entryOverview">The value to check for.</div>
     </td>
   </tr>
  </table>
      </div>
   
      <div class="detailsSection">
        <b>Returns:</b>&nbsp;<span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Boolean">boolean</a></span>&nbsp;
            True if the map contains the value.
      </div>
  
    </div>
   
  </td>


  <td class="view-code">
     <a href="local_closure_goog_structs_structs.js.source.html#line110">code &raquo;</a>
  </td>
     </tr>


     <tr class="even entry public">
       <td class="access"></td>






  <td>
    <a name="goog.structs.every"></a>


     <div class="arg">
       <img align="left" src="static/images/blank.gif">

        <span class="entryNamespace">goog.structs.</span><span class="entryName">every<span class="args">(<span class="arg">col</span>,&nbsp;<span class="arg">f</span>,&nbsp;<span class="arg">opt_obj</span>)</span>
        </span>
        &#8658; <span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Boolean">boolean</a></span>
      </div>


     <div class="entryOverview">
       Calls f for each value in a collection. If all calls return true this return
true this returns true. If any returns false this returns false at this point
 and does not continue to check the remaining values.


     </div>


    <! -- Method details -->
    <div class="entryDetails">

      <div class="detailsSection">
        <b>Arguments: </b>






<table class="horiz-rule">
     
   <tr class="even">
     <td>
        <span class="entryName">col</span>
        : <span class="type">S</span>
        <div class="entryOverview">The collection-like object.</div>
     </td>
   </tr>
     
   <tr class="odd">
     <td>
        <span class="entryName">f</span>
        : <span class="type">function(this:T,?,?,S):boolean</span>
        <div class="entryOverview">The function to call for every
    value. This function takes 3 arguments (the value, the key or
    undefined if the collection has no notion of keys, and the collection)
    and should return a boolean.</div>
     </td>
   </tr>
     
   <tr class="even">
     <td>
        <span class="entryName">opt_obj</span>
        : <span class="type">T=</span>
        <div class="entryOverview">The object to be used as the value of 'this'
    within <code> f</code>.</div>
     </td>
   </tr>
  </table>
      </div>
   
      <div class="detailsSection">
        <b>Returns:</b>&nbsp;<span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Boolean">boolean</a></span>&nbsp;
            True if all key-value pairs pass the test.
      </div>
  
    </div>
   
  </td>


  <td class="view-code">
     <a href="local_closure_goog_structs_structs.js.source.html#line338">code &raquo;</a>
  </td>
     </tr>


     <tr class="odd entry public">
       <td class="access"></td>






  <td>
    <a name="goog.structs.filter"></a>


     <div class="arg">
       <img align="left" src="static/images/blank.gif">

        <span class="entryNamespace">goog.structs.</span><span class="entryName">filter<span class="args">(<span class="arg">col</span>,&nbsp;<span class="arg">f</span>,&nbsp;<span class="arg">opt_obj</span>)</span>
        </span>
        &#8658; <span>!</span><span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Object">Object</a></span><span>&nbsp;|&nbsp;</span><span>!</span><span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Array">Array</a></span>
      </div>


     <div class="entryOverview">
       Calls a function for every value in the collection. When a call returns true,
adds the value to a new collection (Array is returned by default).


     </div>


    <! -- Method details -->
    <div class="entryDetails">

      <div class="detailsSection">
        <b>Arguments: </b>






<table class="horiz-rule">
     
   <tr class="even">
     <td>
        <span class="entryName">col</span>
        : <span class="type">S</span>
        <div class="entryOverview">The collection-like object.</div>
     </td>
   </tr>
     
   <tr class="odd">
     <td>
        <span class="entryName">f</span>
        : <span class="type">function(this:T,?,?,S):boolean</span>
        <div class="entryOverview">The function to call for every
    value. This function takes
    3 arguments (the value, the key or undefined if the collection has no
    notion of keys, and the collection) and should return a Boolean. If the
    return value is true the value is added to the result collection. If it
    is false the value is not included.</div>
     </td>
   </tr>
     
   <tr class="even">
     <td>
        <span class="entryName">opt_obj</span>
        : <span class="type">T=</span>
        <div class="entryOverview">The object to be used as the value of 'this'
    within <code> f</code>.</div>
     </td>
   </tr>
  </table>
      </div>
   
      <div class="detailsSection">
        <b>Returns:</b>&nbsp;<span>!</span><span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Object">Object</a></span><span>&nbsp;|&nbsp;</span><span>!</span><span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Array">Array</a></span>&nbsp;
            A new collection where the passed values are
    present. If col is a key-less collection an array is returned.  If col
    has keys and values a plain old JS object is returned.
      </div>
  
    </div>
   
  </td>


  <td class="view-code">
     <a href="local_closure_goog_structs_structs.js.source.html#line210">code &raquo;</a>
  </td>
     </tr>


     <tr class="even entry public">
       <td class="access"></td>






  <td>
    <a name="goog.structs.forEach"></a>


     <div class="arg">
       <img align="left" src="static/images/blank.gif">

        <span class="entryNamespace">goog.structs.</span><span class="entryName">forEach<span class="args">(<span class="arg">col</span>,&nbsp;<span class="arg">f</span>,&nbsp;<span class="arg">opt_obj</span>)</span>
        </span>
      </div>


     <div class="entryOverview">
       Calls a function for each value in a collection. The function takes
three arguments; the value, the key and the collection.

NOTE: This will be deprecated soon! Please use a more specific method if
possible, e.g. goog.array.forEach, goog.object.forEach, etc.


     </div>


    <! -- Method details -->
    <div class="entryDetails">

      <div class="detailsSection">
        <b>Arguments: </b>






<table class="horiz-rule">
     
   <tr class="even">
     <td>
        <span class="entryName">col</span>
        : <span class="type">S</span>
        <div class="entryOverview">The collection-like object.</div>
     </td>
   </tr>
     
   <tr class="odd">
     <td>
        <span class="entryName">f</span>
        : <span class="type">function(this:T,?,?,S</span>)<span>:?</span>
        <div class="entryOverview">The function to call for every value.
    This function takes
    3 arguments (the value, the key or undefined if the collection has no
    notion of keys, and the collection) and the return value is irrelevant.</div>
     </td>
   </tr>
     
   <tr class="even">
     <td>
        <span class="entryName">opt_obj</span>
        : <span class="type">T=</span>
        <div class="entryOverview">The object to be used as the value of 'this'
    within <code> f</code>.</div>
     </td>
   </tr>
  </table>
      </div>
   
  
    </div>
   
  </td>


  <td class="view-code">
     <a href="local_closure_goog_structs_structs.js.source.html#line176">code &raquo;</a>
  </td>
     </tr>


     <tr class="odd entry public">
       <td class="access"></td>






  <td>
    <a name="goog.structs.getCount"></a>


     <div class="arg">
       <img align="left" src="static/images/blank.gif">

        <span class="entryNamespace">goog.structs.</span><span class="entryName">getCount<span class="args">(<span class="arg">col</span>)</span>
        </span>
        &#8658; <span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Number">number</a></span>
      </div>


     <div class="entryOverview">
       Returns the number of values in the collection-like object.

     </div>


    <! -- Method details -->
    <div class="entryDetails">

      <div class="detailsSection">
        <b>Arguments: </b>






<table class="horiz-rule">
     
   <tr class="even">
     <td>
        <span class="entryName">col</span>
        : <span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Object">Object</a></span>
        <div class="entryOverview">The collection-like object.</div>
     </td>
   </tr>
  </table>
      </div>
   
      <div class="detailsSection">
        <b>Returns:</b>&nbsp;<span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Number">number</a></span>&nbsp;
            The number of values in the collection-like object.
      </div>
  
    </div>
   
  </td>


  <td class="view-code">
     <a href="local_closure_goog_structs_structs.js.source.html#line41">code &raquo;</a>
  </td>
     </tr>


     <tr class="even entry public">
       <td class="access"></td>






  <td>
    <a name="goog.structs.getKeys"></a>


     <div class="arg">
       <img align="left" src="static/images/blank.gif">

        <span class="entryNamespace">goog.structs.</span><span class="entryName">getKeys<span class="args">(<span class="arg">col</span>)</span>
        </span>
        &#8658; <span>!</span><span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Array">Array</a></span><span>&nbsp;|&nbsp;</span><span class="type">undefined</span>
      </div>


     <div class="entryOverview">
       Returns the keys of the collection. Some collections have no notion of
keys/indexes and this function will return undefined in those cases.

     </div>


    <! -- Method details -->
    <div class="entryDetails">

      <div class="detailsSection">
        <b>Arguments: </b>






<table class="horiz-rule">
     
   <tr class="even">
     <td>
        <span class="entryName">col</span>
        : <span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Object">Object</a></span>
        <div class="entryOverview">The collection-like object.</div>
     </td>
   </tr>
  </table>
      </div>
   
      <div class="detailsSection">
        <b>Returns:</b>&nbsp;<span>!</span><span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Array">Array</a></span><span>&nbsp;|&nbsp;</span><span class="type">undefined</span>&nbsp;
            The keys in the collection.
      </div>
  
    </div>
   
  </td>


  <td class="view-code">
     <a href="local_closure_goog_structs_structs.js.source.html#line82">code &raquo;</a>
  </td>
     </tr>


     <tr class="odd entry public">
       <td class="access"></td>






  <td>
    <a name="goog.structs.getValues"></a>


     <div class="arg">
       <img align="left" src="static/images/blank.gif">

        <span class="entryNamespace">goog.structs.</span><span class="entryName">getValues<span class="args">(<span class="arg">col</span>)</span>
        </span>
        &#8658; <span>!</span><span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Array">Array</a></span>
      </div>


     <div class="entryOverview">
       Returns the values of the collection-like object.

     </div>


    <! -- Method details -->
    <div class="entryDetails">

      <div class="detailsSection">
        <b>Arguments: </b>






<table class="horiz-rule">
     
   <tr class="even">
     <td>
        <span class="entryName">col</span>
        : <span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Object">Object</a></span>
        <div class="entryOverview">The collection-like object.</div>
     </td>
   </tr>
  </table>
      </div>
   
      <div class="detailsSection">
        <b>Returns:</b>&nbsp;<span>!</span><span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Array">Array</a></span>&nbsp;
            The values in the collection-like object.
      </div>
  
    </div>
   
  </td>


  <td class="view-code">
     <a href="local_closure_goog_structs_structs.js.source.html#line57">code &raquo;</a>
  </td>
     </tr>


     <tr class="even entry public">
       <td class="access"></td>






  <td>
    <a name="goog.structs.isEmpty"></a>


     <div class="arg">
       <img align="left" src="static/images/blank.gif">

        <span class="entryNamespace">goog.structs.</span><span class="entryName">isEmpty<span class="args">(<span class="arg">col</span>)</span>
        </span>
        &#8658; <span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Boolean">boolean</a></span>
      </div>


     <div class="entryOverview">
       Whether the collection is empty.

     </div>


    <! -- Method details -->
    <div class="entryDetails">

      <div class="detailsSection">
        <b>Arguments: </b>






<table class="horiz-rule">
     
   <tr class="even">
     <td>
        <span class="entryName">col</span>
        : <span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Object">Object</a></span>
        <div class="entryOverview">The collection-like object.</div>
     </td>
   </tr>
  </table>
      </div>
   
      <div class="detailsSection">
        <b>Returns:</b>&nbsp;<span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Boolean">boolean</a></span>&nbsp;
            True if empty.
      </div>
  
    </div>
   
  </td>


  <td class="view-code">
     <a href="local_closure_goog_structs_structs.js.source.html#line129">code &raquo;</a>
  </td>
     </tr>


     <tr class="odd entry public">
       <td class="access"></td>






  <td>
    <a name="goog.structs.map"></a>


     <div class="arg">
       <img align="left" src="static/images/blank.gif">

        <span class="entryNamespace">goog.structs.</span><span class="entryName">map<span class="args">(<span class="arg">col</span>,&nbsp;<span class="arg">f</span>,&nbsp;<span class="arg">opt_obj</span>)</span>
        </span>
        &#8658; <span>!</span><span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Object">Object</a></span>.&lt;<span class="type">V</span>&gt;<span>&nbsp;|&nbsp;</span><span>!</span><span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Array">Array</a></span>.&lt;<span class="type">V</span>&gt;
      </div>


     <div class="entryOverview">
       Calls a function for every value in the collection and adds the result into a
new collection (defaults to creating a new Array).


     </div>


    <! -- Method details -->
    <div class="entryDetails">

      <div class="detailsSection">
        <b>Arguments: </b>






<table class="horiz-rule">
     
   <tr class="even">
     <td>
        <span class="entryName">col</span>
        : <span class="type">S</span>
        <div class="entryOverview">The collection-like object.</div>
     </td>
   </tr>
     
   <tr class="odd">
     <td>
        <span class="entryName">f</span>
        : <span class="type">function(this:T,?,?,S):V</span>
        <div class="entryOverview">The function to call for every value.
    This function takes 3 arguments (the value, the key or undefined if the
    collection has no notion of keys, and the collection) and should return
    something. The result will be used as the value in the new collection.</div>
     </td>
   </tr>
     
   <tr class="even">
     <td>
        <span class="entryName">opt_obj</span>
        : <span class="type">T=</span>
        <div class="entryOverview">The object to be used as the value of 'this'
    within <code> f</code>.</div>
     </td>
   </tr>
  </table>
      </div>
   
      <div class="detailsSection">
        <b>Returns:</b>&nbsp;<span>!</span><span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Object">Object</a></span>.&lt;<span class="type">V</span>&gt;<span>&nbsp;|&nbsp;</span><span>!</span><span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Array">Array</a></span>.&lt;<span class="type">V</span>&gt;&nbsp;
            A new collection with the new values.  If
    col is a key-less collection an array is returned.  If col has keys and
    values a plain old JS object is returned.
      </div>
  
    </div>
   
  </td>


  <td class="view-code">
     <a href="local_closure_goog_structs_structs.js.source.html#line260">code &raquo;</a>
  </td>
     </tr>


     <tr class="even entry public">
       <td class="access"></td>






  <td>
    <a name="goog.structs.some"></a>


     <div class="arg">
       <img align="left" src="static/images/blank.gif">

        <span class="entryNamespace">goog.structs.</span><span class="entryName">some<span class="args">(<span class="arg">col</span>,&nbsp;<span class="arg">f</span>,&nbsp;<span class="arg">opt_obj</span>)</span>
        </span>
        &#8658; <span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Boolean">boolean</a></span>
      </div>


     <div class="entryOverview">
       Calls f for each value in a collection. If any call returns true this returns
true (without checking the rest). If all returns false this returns false.


     </div>


    <! -- Method details -->
    <div class="entryDetails">

      <div class="detailsSection">
        <b>Arguments: </b>






<table class="horiz-rule">
     
   <tr class="even">
     <td>
        <span class="entryName">col</span>
        : <span class="type">S</span>
        <div class="entryOverview">The collection-like object.</div>
     </td>
   </tr>
     
   <tr class="odd">
     <td>
        <span class="entryName">f</span>
        : <span class="type">function(this:T,?,?,S):boolean</span>
        <div class="entryOverview">The function to call for every
    value. This function takes 3 arguments (the value, the key or undefined
    if the collection has no notion of keys, and the collection) and should
    return a boolean.</div>
     </td>
   </tr>
     
   <tr class="even">
     <td>
        <span class="entryName">opt_obj</span>
        : <span class="type">T=</span>
        <div class="entryOverview">The object to be used as the value of 'this'
    within <code> f</code>.</div>
     </td>
   </tr>
  </table>
      </div>
   
      <div class="detailsSection">
        <b>Returns:</b>&nbsp;<span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Boolean">boolean</a></span>&nbsp;
            True if any value passes the test.
      </div>
  
    </div>
   
  </td>


  <td class="view-code">
     <a href="local_closure_goog_structs_structs.js.source.html#line304">code &raquo;</a>
  </td>
     </tr>


  </table>
</div>



  <h2>Global Properties</h2>





<div class="section">
  <table class="horiz-rule">


     <tr class="even entry public">
       <td class="access"></td>





  <a name="goog.structs.AvlTreeTest"></a>

  <td>


     <div class="arg">
        <img align="left" src="static/images/blank.gif">

        <span class="entryNamespace">goog.structs.</span><span class="entryName">AvlTreeTest</span>
        : 
     </div>


     <div class="entryOverview">
       <span class='nodesc'>No description.</span>
     </div>

  </td>


  <td class="view-code">
     <a href="local_closure_goog_structs_avltree_test.js.source.html#line15">Code &raquo;</a>
  </td>
     </tr>


     <tr class="odd entry public">
       <td class="access"></td>





  <a name="goog.structs.CircularBufferTest"></a>

  <td>


     <div class="arg">
        <img align="left" src="static/images/blank.gif">

        <span class="entryNamespace">goog.structs.</span><span class="entryName">CircularBufferTest</span>
        : 
     </div>


     <div class="entryOverview">
       <span class='nodesc'>No description.</span>
     </div>

  </td>


  <td class="view-code">
     <a href="local_closure_goog_structs_circularbuffer_test.js.source.html#line15">Code &raquo;</a>
  </td>
     </tr>


     <tr class="even entry public">
       <td class="access"></td>





  <a name="goog.structs.CollectionTest"></a>

  <td>


     <div class="arg">
        <img align="left" src="static/images/blank.gif">

        <span class="entryNamespace">goog.structs.</span><span class="entryName">CollectionTest</span>
        : 
     </div>


     <div class="entryOverview">
       <span class='nodesc'>No description.</span>
     </div>

  </td>


  <td class="view-code">
     <a href="local_closure_goog_structs_collection_test.js.source.html#line15">Code &raquo;</a>
  </td>
     </tr>


     <tr class="odd entry public">
       <td class="access"></td>





  <a name="goog.structs.HeapTest"></a>

  <td>


     <div class="arg">
        <img align="left" src="static/images/blank.gif">

        <span class="entryNamespace">goog.structs.</span><span class="entryName">HeapTest</span>
        : 
     </div>


     <div class="entryOverview">
       <span class='nodesc'>No description.</span>
     </div>

  </td>


  <td class="view-code">
     <a href="local_closure_goog_structs_heap_test.js.source.html#line15">Code &raquo;</a>
  </td>
     </tr>


     <tr class="even entry public">
       <td class="access"></td>





  <a name="goog.structs.InversionMapTest"></a>

  <td>


     <div class="arg">
        <img align="left" src="static/images/blank.gif">

        <span class="entryNamespace">goog.structs.</span><span class="entryName">InversionMapTest</span>
        : 
     </div>


     <div class="entryOverview">
       <span class='nodesc'>No description.</span>
     </div>

  </td>


  <td class="view-code">
     <a href="local_closure_goog_structs_inversionmap_test.js.source.html#line15">Code &raquo;</a>
  </td>
     </tr>


     <tr class="odd entry public">
       <td class="access"></td>





  <a name="goog.structs.LinkedMapTest"></a>

  <td>


     <div class="arg">
        <img align="left" src="static/images/blank.gif">

        <span class="entryNamespace">goog.structs.</span><span class="entryName">LinkedMapTest</span>
        : 
     </div>


     <div class="entryOverview">
       <span class='nodesc'>No description.</span>
     </div>

  </td>


  <td class="view-code">
     <a href="local_closure_goog_structs_linkedmap_test.js.source.html#line15">Code &raquo;</a>
  </td>
     </tr>


     <tr class="even entry public">
       <td class="access"></td>





  <a name="goog.structs.MapTest"></a>

  <td>


     <div class="arg">
        <img align="left" src="static/images/blank.gif">

        <span class="entryNamespace">goog.structs.</span><span class="entryName">MapTest</span>
        : 
     </div>


     <div class="entryOverview">
       <span class='nodesc'>No description.</span>
     </div>

  </td>


  <td class="view-code">
     <a href="local_closure_goog_structs_map_test.js.source.html#line15">Code &raquo;</a>
  </td>
     </tr>


     <tr class="odd entry public">
       <td class="access"></td>





  <a name="goog.structs.PoolTest"></a>

  <td>


     <div class="arg">
        <img align="left" src="static/images/blank.gif">

        <span class="entryNamespace">goog.structs.</span><span class="entryName">PoolTest</span>
        : 
     </div>


     <div class="entryOverview">
       <span class='nodesc'>No description.</span>
     </div>

  </td>


  <td class="view-code">
     <a href="local_closure_goog_structs_pool_test.js.source.html#line15">Code &raquo;</a>
  </td>
     </tr>


     <tr class="even entry public">
       <td class="access"></td>





  <a name="goog.structs.PriorityPoolTest"></a>

  <td>


     <div class="arg">
        <img align="left" src="static/images/blank.gif">

        <span class="entryNamespace">goog.structs.</span><span class="entryName">PriorityPoolTest</span>
        : 
     </div>


     <div class="entryOverview">
       <span class='nodesc'>No description.</span>
     </div>

  </td>


  <td class="view-code">
     <a href="local_closure_goog_structs_prioritypool_test.js.source.html#line15">Code &raquo;</a>
  </td>
     </tr>


     <tr class="odd entry public">
       <td class="access"></td>





  <a name="goog.structs.PriorityQueueTest"></a>

  <td>


     <div class="arg">
        <img align="left" src="static/images/blank.gif">

        <span class="entryNamespace">goog.structs.</span><span class="entryName">PriorityQueueTest</span>
        : 
     </div>


     <div class="entryOverview">
       <span class='nodesc'>No description.</span>
     </div>

  </td>


  <td class="view-code">
     <a href="local_closure_goog_structs_priorityqueue_test.js.source.html#line15">Code &raquo;</a>
  </td>
     </tr>


     <tr class="even entry public">
       <td class="access"></td>





  <a name="goog.structs.QuadTreeTest"></a>

  <td>


     <div class="arg">
        <img align="left" src="static/images/blank.gif">

        <span class="entryNamespace">goog.structs.</span><span class="entryName">QuadTreeTest</span>
        : 
     </div>


     <div class="entryOverview">
       <span class='nodesc'>No description.</span>
     </div>

  </td>


  <td class="view-code">
     <a href="local_closure_goog_structs_quadtree_test.js.source.html#line15">Code &raquo;</a>
  </td>
     </tr>


     <tr class="odd entry public">
       <td class="access"></td>





  <a name="goog.structs.QueueTest"></a>

  <td>


     <div class="arg">
        <img align="left" src="static/images/blank.gif">

        <span class="entryNamespace">goog.structs.</span><span class="entryName">QueueTest</span>
        : 
     </div>


     <div class="entryOverview">
       <span class='nodesc'>No description.</span>
     </div>

  </td>


  <td class="view-code">
     <a href="local_closure_goog_structs_queue_test.js.source.html#line15">Code &raquo;</a>
  </td>
     </tr>


     <tr class="even entry public">
       <td class="access"></td>





  <a name="goog.structs.SetTest"></a>

  <td>


     <div class="arg">
        <img align="left" src="static/images/blank.gif">

        <span class="entryNamespace">goog.structs.</span><span class="entryName">SetTest</span>
        : 
     </div>


     <div class="entryOverview">
       <span class='nodesc'>No description.</span>
     </div>

  </td>


  <td class="view-code">
     <a href="local_closure_goog_structs_set_test.js.source.html#line15">Code &raquo;</a>
  </td>
     </tr>


     <tr class="odd entry public">
       <td class="access"></td>





  <a name="goog.structs.StringSetTest"></a>

  <td>


     <div class="arg">
        <img align="left" src="static/images/blank.gif">

        <span class="entryNamespace">goog.structs.</span><span class="entryName">StringSetTest</span>
        : 
     </div>


     <div class="entryOverview">
       <span class='nodesc'>No description.</span>
     </div>

  </td>


  <td class="view-code">
     <a href="local_closure_goog_structs_stringset_test.js.source.html#line15">Code &raquo;</a>
  </td>
     </tr>


     <tr class="even entry public">
       <td class="access"></td>





  <a name="goog.structs.TreeNodeTest"></a>

  <td>


     <div class="arg">
        <img align="left" src="static/images/blank.gif">

        <span class="entryNamespace">goog.structs.</span><span class="entryName">TreeNodeTest</span>
        : 
     </div>


     <div class="entryOverview">
       <span class='nodesc'>No description.</span>
     </div>

  </td>


  <td class="view-code">
     <a href="local_closure_goog_structs_treenode_test.js.source.html#line15">Code &raquo;</a>
  </td>
     </tr>


     <tr class="odd entry public">
       <td class="access"></td>





  <a name="goog.structs.TrieTest"></a>

  <td>


     <div class="arg">
        <img align="left" src="static/images/blank.gif">

        <span class="entryNamespace">goog.structs.</span><span class="entryName">TrieTest</span>
        : 
     </div>


     <div class="entryOverview">
       <span class='nodesc'>No description.</span>
     </div>

  </td>


  <td class="view-code">
     <a href="local_closure_goog_structs_trie_test.js.source.html#line15">Code &raquo;</a>
  </td>
     </tr>


  </table>
</div>
      <!-- Column 1 end -->
    </div>

        <div class="col2">
          <!-- Column 2 start -->
          <div class="col2-c">
            <h2 id="ref-head">Package structs</h2>
            <div id="localView"></div>
          </div>

          <div class="col2-c">
            <h2 id="ref-head">Package Reference</h2>
            <div id="sideTypeIndex" rootPath="" current="structs"></div>
          </div>
          <!-- Column 2 end -->
        </div>
</div>
</div>

</body>
</html>
